package model.path;

import java.awt.Point;
import java.io.Serializable;

import model.enumTypes.CSMoveStyle;



/**
 * This class implements a CS movement node : the time
 * the player will reach the node, the time the player
 * will wait on the node and the move style the player
 * will adopt once it will reach the node.
 * 
 * @author Urbanek Lucas (aka NaG)
 */
public class CSNode extends Point implements Serializable {
	private double time;
	private double waitTime;
	private CSMoveStyle moveStyle;
	
	/**
	 * This is one of the CSNode constructors.
	 * Easy to understand.
	 * The default move style is RUN.
	 * 
	 * @param x_
	 * @param y_
	 * @param time_
	 */
	public CSNode(int x_, int y_, double time_) {
		this.x = x_;
		this.y = y_;
		time = time_;
		waitTime = 0;
		moveStyle = CSMoveStyle.RUN;
	}
	/**
	 * This is one of the CSNode constructors.
	 * Easy to understand.
	 * The default move style is RUN.
	 * 
	 * @param x_
	 * @param y_
	 * @param time_
	 * @param waitTime_
	 */
	public CSNode(int x_, int y_, double time_, double waitTime_) {
		this.x = x_;
		this.y = y_;
		time = time_;
		waitTime = waitTime_;
		moveStyle = CSMoveStyle.RUN;
	}
	/**
	 * This is one of the CSNode constructors.
	 * Easy to understand.
	 * 
	 * @param x_
	 * @param y_
	 * @param time_
	 * @param waitTime_
	 * @param mov
	 */
	public CSNode(int x_, int y_, double time_, double waitTime_, CSMoveStyle mov) {
		this.x = x_;
		this.y = y_;
		time = time_;
		waitTime = waitTime_;
		moveStyle = mov;
	}
	/**
	 * This is one of the CSNode constructors.
	 * Easy to understand.
	 * 
	 * @param x_
	 * @param y_
	 * @param time_
	 * @param mov
	 */
	public CSNode(int x_, int y_, double time_, CSMoveStyle mov) {
		this.x = x_;
		this.y = y_;
		time = time_;
		waitTime = 0;
		moveStyle = mov;
	}
	
	public Point getPosition() {
		return new Point(x,y);
	}
	
	public void setPosition(int x_, int y_) {
		this.x = x_;
		this.y = y_;
	}
	
	public void setPosition(Point pt) {
		this.setPosition(pt.x, pt.y);
	}
	
	public double getTime() {
		return time;
	}
	
	public void setTime(double time_) {
		time = ((int)time_*100)/100d;
	}
	
	public double getWaitTime() {
		return waitTime;
	}
	
	public void setWaitTime(double wait) {
		waitTime = ((int)wait*100)/100d;
	}
	
	public CSMoveStyle getMoveStyle() {
		return moveStyle;
	}
	
	public void setMoveStyle(CSMoveStyle mov) {
		moveStyle = mov;
	}
}
